keeper: reserve/commit journal with top-of-sweep reconcile - #587
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a reserve/commit journal to the keeper sweep. On each sweep, pending reservations left
RESERVEDbut notCOMMITTEDare reconciled via the venue idempotency key rather than skipped or blindly resubmitted.Journal::pendingis exposed as an operator enumerate surface for a poisoned or quarantined module.Why
A reserve marker with no matching commit is ambiguous: it can mean the submit was accepted but the commit write faulted, or the process crashed or was cancelled mid-submit. Skipping it silently drops an order a slow venue deadline-cancelled; resubmitting it risks a duplicate. Only the venue can resolve that, so reconciliation belongs at the top of the sweep, keyed on the reservation, not in a post-submit release call that no crash, trap, or
OutOfFuelpath reaches.Testing
Full battery, all green in
/code/nxm/wt-m4-573d:cargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-features --locked -- -D warningscargo build --release --target wasm32-wasip2 --locked(16 modules, then cow-venue/adapter separately); wasm count asserted at 17cargo nextest run --workspace --all-features --no-fail-fast --locked(822 run, 822 passed, 1 skipped; new w1/w2/w3 + anti_572 cases pass)cargo test --doc --workspace --all-features --lockedRUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --lockedscripts/check-venue-agnostic.shscripts/check-cow-orderbook-only.shAI Assistance
Implemented with Claude Code.
Completes the reserve/commit/reconcile chain at L3, after #583 (journal API), #584 (venue idempotency contract) and #586 (keeper rewire). Refs #573.